import { http, queryString } from './httpServer'

// 今日收益
export function getIncomeTody(payload) {
	return http.get(`/mall/app/agent/v1/agent/income/today?${queryString(payload)}`).exec()
}

export function getFrontData() {
	return http.get(`/mall/app/agent/v1/agent/frontdata`).exec()
}

export function getAccountBalance() {
	return http.get('/mall/app/agent/v1/acount').exec()
}

export function doWithDraw(params) {
	return http.post('/mall/app/agent/v1/acount/cashout', params).exec()
}

export function getCurrents(params) {
	return http.get(`/mall/app/agent/v1/acount/currents?${queryString(params)}`).exec()
}

export function getLowLevelList(params) {
	return http.get(`/mall/app/agent/v1/branchs?${queryString(params)}`).exec()
}

export function getCustomers(params) {
	return http.get(`/mall/app/agent/v1/custs?${queryString(params)}`).exec()
}

export function getOrders(params) {
	return http.get(`/mall/app/agent/v1/orders?${queryString(params)}`).exec()
}

export function getQrCode(type) {
	return http.get(`/mall/app/agent/v1/getqrcode?type=${type}`).exec()
}

export function bindAgentor(agentorId) {
	return http.post('/mall/app/agent/v1/agent/bind', agentorId).dispose_server_error().withLoading().exec()
}

export function registerAgentor(agentorId) {
	return http.post('/mall/app/agent/v1/agent/register', agentorId).dispose_server_error().withLoading().exec()
}

export function saleamountDetail(pageNum, pageSize) {
	return http.get(`/mall/app/agent/v1/agent/saleamount/detail?pageNum=${pageNum}&pageSize=${pageSize}`).exec()
}